Fixed Volume Box: Square-based

The task here is to find the dimensions of a box having a minumum surface area for a given,  fixed volume, V.  In this box the width and depth are constrained to be the same length, therefore it is square-based.

Alter the Width (x) of the fixed volume box to find minimums of the total exterior Surface Area with and without a lid, respectively.

MaxVol

Hint (for Lid)

Hint (for No Lid)

xyz-Data

α = 2.6354471705114375 rad (slider from 90*° to 180*°, step 0.017453292519943295)
MaxVol = 1000
Vol = 512 (slider from 0 to MaxVol, step 0.5)
A = Intersect(xAxis, yAxis)
c = Circle(A, 1000)
D, E = Intersect(c, xAxis)
E' = Rotate(E, -α, A)
midP = Midpoint(A, E')
p_2 = Segment(A, midP)
B = Point(xAxis)
a = Segment(A, Point[Circle[A, cbrt(MaxVol)^(2)]])
C = Point(a)
b = Segment(A, C)
β = Angle(E', A, E)
d = Ray(A, E')
d_X = Distance(A, C)
E'_1 = Rotate(E, -(α - (5 * d_X)°), C)
γ = Angle(E'_1, C, E)
e = Ray(C, E'_1)
F = Point(d)
G: (d_X * cos(α), -d_X * sin(α))
d_Y = Segment(A, G)
h = Line(G, b)
H = Intersect(h, e)
i = Segment(G, H)
j = Segment(H, C)
k = OrthogonalLine(C, b)
l = OrthogonalLine(H, b)
m = OrthogonalLine(A, b)
n = OrthogonalLine(G, b)
d_Z: Vol / (d_X * d_Y)
g = Circle(A, d_Z)
I, J = Intersect(g, m)
p = Segment(A, J)
q = OrthogonalLine(J, p)
K = Intersect(q, k)
r = Circle(J, 1000)
L, M = Intersect(r, q)
L' = Rotate(L, -(α + (3 * d_Z)°), J)
δ = Angle(L', J, L)
s = Ray(J, L')
N = Intersect(n, s)
t = Line(N, q)
O = Intersect(t, l)
a_1 = Segment(K, O)
b_1 = Segment(J, N)
c_1 = Segment(G, N)
d_1 = Segment(O, H)
e_1 = Segment(K, C)
f_1 = Segment(O, N)
g_1 = Segment(J, K)
ε = Angle(A, C, H)
h_1 = Segment(C, H)
i_1 = Segment(K, C)
ζ = Angle(N, J, A)
j_1 = Segment(N, J)
k_1 = Segment(K, J)
Lid = true
P = Intersect(p, f_1)
Q = Intersect(e_1, f_1)
l_1 = Segment(J, P)
m_1 = Segment(P, A)
n_1 = Segment(K, Q)
p_1 = Segment(Q, C)
q_1 = Segment(O, K)
poly1, a_2, g_2, h_2, c_2 = Polygon(A, G, H, C)
poly2, j_2, a_3, g_3, n_2 = Polygon(J, A, G, N)
poly3, n_3, o, h_3, g_4 = Polygon(N, O, H, G)
poly4, j_3, a_4, c_3, k_2 = Polygon(J, A, C, K)
poly5, k_3, o_1, h_4, c_4 = Polygon(K, O, H, C)
poly6, n_4, j_4, k_4, o_2 = Polygon(N, J, K, O)
y_{Front}: y(N)
y_{Back}: y(A)
R = Intersect(d_Y, f_1)
S = Intersect(j, f_1)
r_1 = Segment(R, A)
s_1 = Segment(A, C)
t_1 = Segment(C, S)
b_2 = Segment(A, J)
d_2 = Segment(C, K)
T = Intersect(p, f_1)
U = Intersect(e_1, f_1)
e_2 = Segment(T, J)
f_2 = Segment(U, K)
y_{Top}: y(J)
i_2 = Segment(J, A)
l_2 = Segment(K, C)
SA_{Lid}: 2 * (d_X * d_Y + d_Y * d_Z + d_Z * d_X)
SA_{NoLid}: SA_{Lid} - d_X * d_Y
P_{Lid}: (d_X, SA_{Lid})
P_{NoLid}: (d_X, SA_{NoLid})
CRVol: Vol^(1 / 3)
text5: "$ SA_{Lid} =" + (LaTeX[SA_{Lid}]) + "  \; cm^{2}$"
text6: "$ SA_{NoLid} =  " + (LaTeX[SA_{NoLid}]) + " \; cm^{2}$"
text1: "$ 

\begin{array}{} x = " + (LaTeX[d_X]) + " \; cm \\ y = " + (LaTeX[d_Y]) + " \; cm \\ z = " + (LaTeX[d_Z]) + " \; cm \end{array} 

 $"
yLength: floor(Distance[A, E'])
list1 = Sequence((x(A) + k * (x(F) - x(A)) / yLength, y(A) + k * (y(F) - y(A)) / yLength), k, 1, yLength)
text2: "(0, " + d_Y + ", 0)"
text3: "(" + d_X + ", 0, 0)"
text7: "(0, 0, " + d_Z + ")"
inputBox1 = Textfield(MaxVol)
m_2 = Segment(A, E')
list2 = Sequence(Segment[(x(A) + k * (x(E') - x(A)) / yLength, y(A) + k * (y(E') - y(A)) / yLength), (x(A) - 0.3 + k * (x(E') - x(A)) / yLength, y(A) + k * (y(E') - y(A)) / yLength)], k, 1, yLength)
u = false
text4: "$ x=y=z=\sqrt[3]{V}=" + (LaTeX[CRVol]) + " \; cm $"
Lid_{Min}: (cbrt(Vol), 6 * cbrt(Vol)^(2))
CRVol_1: Vol^(1 / 3)
Lid_1: (cbrt(Vol), 6 * cbrt(Vol)^(2))
v = false
CR2Vol: cbrt(2 * Vol)
HCR2Vol: 0.5 * CR2Vol
text4_1: "$ x=y=\sqrt[3]{2V}=" + (LaTeX[CR2Vol]) + " \; cm, z=\frac{1}{2}\sqrt[3]{2V}= " + (LaTeX[HCR2Vol]) + " \; cm$"
NoLid_{Min}: (CR2Vol, 3 * CR2Vol^(2))
Lid_3(x) = 2 * x^(2) + 4 * Vol / x
NoLid(x) = x^(2) + 4 * Vol / x
z = false
u_1: ¬Lid
v_1: ¬Lid
w_1: ¬Lid
z_1: ¬Lid
q_2: ¬Lid
s_2 = If(Lid, If[v, ¬v], If[u, ¬u])
t_2: ¬Lid
v_2 = If(Lid, If[v, ¬v], If[u, ¬u])
w_2: ¬Lid
b_3 = If(Lid, If[v, ¬v], If[u, ¬u])
d_3: ¬Lid
f_3 = If(Lid, If[v, ¬v], If[u, ¬u])
i_3: ¬Lid
m_3 = If(Lid, If[v, ¬v], If[u, ¬u])
o_3: ¬Lid
q_3 = If(Lid, If[v, ¬v], If[u, ¬u])
r_3: ¬Lid
t_3 = If(Lid, If[v, ¬v], If[u, ¬u])
v_3 = If(Lid, If[v, ¬v], If[u, ¬u])
z_3 = If(Lid, If[v, ¬v], If[u, ¬u])
d_4 = If(Lid, If[v, ¬v], If[u, ¬u])
f_4 = If(Lid, If[v, ¬v], If[u, ¬u])
l_4 = If(Lid, If[v, ¬v], If[u, ¬u])